package com.guigu.www.denghao.controller;

import com.guigu.www.denghao.service.DHShortcutService;
import com.guigu.www.pojo.Shortcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/ShortcutController")
public class DHShortcutController {

    @Autowired
    private DHShortcutService shortcutService;

    @PostMapping("/addShortcut")
    public Integer addShortcut(Shortcut shortcut){
        return shortcutService.addShortcut(shortcut);
    }

    @PostMapping("/queryByHmIdShortcut")
    public List<Shortcut> queryByHmIdShortcut(Integer hmId){
        return shortcutService.queryByHmIdShortcut(hmId);
    }

    @DeleteMapping("{shoId}")
    public Integer delShortcutById(@PathVariable Integer shoId){
        return shortcutService.delShortcutById(shoId);
    }
}
